package com.alibaba.nacos;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * nacos启动类
 *
 * @author ZhangYu
 * @date 2024/11/24
 */
@EnableScheduling
@ServletComponentScan
@SpringBootApplication(scanBasePackages = "com.alibaba.nacos")
public class NacosServerApplication {

    public static void main(String[] args) {
        //是否单机模式启动
        String standalone = "true";
        System.setProperty("nacos.standalone", standalone);
        //是否开启鉴权
        String enabled = "false";
        System.setProperty("nacos.core.auth.enabled", enabled);
        System.setProperty("server.tomcat.basedir", "logs");
        //自定义启动端口号
        System.setProperty("server.port", "8848");
        SpringApplication.run(NacosServerApplication.class, args);
    }

}
